function zeroes=geq_solver_policy(input,iota,mu,gamma,rho,phi,theta)

global eta lambda zeta
global chi nu
global epsilon beta delta delta_p
global Q alphah alphal mh ml
global ss

ih=input(1);
il=input(2);
omegah=input(3);
omegal=input(4);
a=input(5);
v1h=input(6);
v1l=input(7);
ns=input(8);

nbh=alphah*(1-ih*X(omegah));
nbl=alphal*(1-il*X(omegal));
nb=nbh+nbl;

sigmah=nbh/nb;
sigmal=nbl/nb;
mb=phi*(ns/nb)^nu;
ms=phi*(nb/ns)^(1-nu);

eh=(alphah*mh*a+alphal*ml)*(alphah*Q(1,1)+alphal*Q(2,1))/((alphah*mh+alphal*ml)*(alphah*Q(1,1)*a+alphal*Q(2,1)));
el=(alphah*mh*a+alphal*ml)*(alphal*Q(2,2)+alphah*Q(1,2))/((alphah*mh+alphal*ml)*(alphal*Q(2,2)+alphah*Q(1,2)*a));
gh=1+gamma*eh*(ih*X(omegah)+(1-ih*X(omegah))*mb);
gl=1+gamma*el*(il*X(omegal)+(1-il*X(omegal))*mb);

g=gh*(alphah*Q(1,1)+alphal*Q(2,1)/a)/(alphah*Q(1,1)+alphal*Q(2,1));
r=beta/(g^(epsilon*zeta/(lambda+zeta)));
rt=1/r-1+delta;
A=zeta*((eta/rt)^(eta/(lambda+zeta)))*(g*(alphah*mh+alphal*ml))^(-lambda/(lambda+zeta));

Bh=A*mh+r*(Q(1,1)*v1h+Q(1,2)*v1l)*g^(-lambda/(lambda+zeta));
Bl=A*ml+r*(Q(2,1)*v1h+Q(2,2)*v1l)*g^(-lambda/(lambda+zeta));
o=(ms*theta*(sigmah*Bh+sigmal*Bl)*gamma)/(1-(1-ms*theta)*r*delta_p*g^(zeta/(lambda+zeta)));

zeroes(1)=ih-((1/((1-ss)*chi))*(X(omegah)*((1-mb*(1-theta))*Bh*gamma+mb*(1-theta)*r*delta_p*o*g^(zeta/(lambda+zeta)))+(1-X(omegah))*o))^(1/rho);
zeroes(2)=il-((1/((1-ss)*chi))*(X(omegal)*((1-mb*(1-theta))*Bl*gamma+mb*(1-theta)*r*delta_p*o*g^(zeta/(lambda+zeta)))+(1-X(omegal))*o))^(1/rho);
zeroes(3)=mu*omegah^iota-(ih*Xp(omegah)*((1-mb*(1-theta))*Bh*gamma+mb*(1-theta)*r*delta_p*o*g^(zeta/(lambda+zeta))-o));
zeroes(4)=mu*omegal^iota-(il*Xp(omegal)*((1-mb*(1-theta))*Bl*gamma+mb*(1-theta)*r*delta_p*o*g^(zeta/(lambda+zeta))-o));
zeroes(5)=a-gh*(alphah*Q(1,1)*a+alphal*Q(2,1))*(alphal*Q(2,2)+alphah*Q(1,2))/(gl*(alphah*Q(1,1)+alphal*Q(2,1))*(alphal*Q(2,2)+alphah*Q(1,2)*a));
zeroes(6)=v1h-Bh;
zeroes(7)=v1l-Bl;
zeroes(8)=ns-(alphah*ih*(1-X(omegah))+alphal*il*(1-X(omegal)))/(1-delta_p*(1-ms));

